<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* .div1{width: 100px;height: 100px;margin-bottom: 20px;background: darkcyan;}
        .div2{width: 100px;height: 100px;margin-top: 30px;background: darkgoldenrod;}
        /* 这里了可以添加任何可以出发BFC的元素 */
        /* .box{overflow: hidden;}  */
        .div1{width: 200px;height: 200px;background: darkgoldenrod;overflow: hidden;}
        .div2{width: 100px;height: 100px;background: darkgreen;margin-top: 30px;}
    </style>
</head>
<body>
    <!-- <div class="box">
        <div class="div1"></div>
    </div>
    <div class="box">
        <div class="div2"></div>
    </div> -->
    <div class="div1">
        <div class="div2"></div>
    </div>
</body>
</html>